<?php
if($_POST["btn_logar"] == "Logar"){
    if(!login()){
        echo "<script>alert('Falha no login')</script>";
    }else{
        echo "<script>location.href=''</script>";
    }
}
?>
<!--
            <header id="header_login">
                <img src="imagens/sgm.png" alt="SGM">
                <div><label>Sistema de Controle de Eventos</label></div>
            </header>
-->
            <section id="session_login">
                <form id="form_login" action="" method="post">
                    <input type="hidden" name="evento" value="<?=$evento->get_id()?>">
                    <div>
                        <h1>MENU DO INSCRITO</h1>
                    </div>
                    
                    <div id="autenticacao">
                        <fieldset  style="width:300px">
                        <legend> Autenticação </legend>
                        
                        <table style="width:300px; margin: 10px 15px">
                            <tr>
                                <td align="right">
                                    <label>CPF: </label>
                                </td>
                                <td align="left">
                                    <input type="text" name="login" autofocus><br>
                                    Digite somente números
                                    <!--<input type="text" name="login" autofocus maxlength="14" OnKeyPress="formatar(this, '000.000.000-00')">-->
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <label>Senha: </label>                                    
                                </td>
                                <td align="left">
                                    <input type="password" name="senha" autocomplete="off">
                                </td>
                            </tr>
                            <tr>
                                <td></td>
                                <td>
                                    <button type="submit" name="btn_logar" value="Logar" id="form_submit">Entrar</button>
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                        
                    </div>                    

                </form>
                <div id="rec_senha">
                    <a href="?evento=<?=$evento->get_id()?>&esq=1" title="Clique para recuperar sua senha">Esqueceu sua senha?</a>
                </div>
            </section>